<template>
<view :style="theme" class="page">

<!-- 首次进入引导添加到“我的小程序” -->
<!--view class="addMyMiniapp" v-if="isFirst" @tap.stop="shutAddMyMiniapp">
	<view>点击加入我的小程序 ↑</view>
	<text>了解"{{webSiteName}}"最新文章</text>:style="backgroundStyle"  :style="{backgroundImage: 'url(' + domain +'/static/default/web/img/beijing-bangzhu.jpg)'}"
</view-->
	<!--PC顶部-->
	<view class="d-beijing-gao" :style="{'backgroundImage':getbeijingtu.beijingtu ? 'url('+getbeijingtu.beijingtu+')':'url('+ domain +'/static/default/web/img/beijing-bangzhu.jpg)','backgroundPosition': 'center'}">
        <u-navbar-tm
			title="个人中心"

			@leftClick="fanhui()"
			:bgColor="bgColor"
		>
		<view
			class="u-nav-slot"
			slot="right"
		>
			<u-icon
			@click="mybeijingtu"
				name="setting-fill"
				size="20"
			></u-icon>
		</view>
		</u-navbar-tm>
	</view>
	<view class="d-kuan d-gao-30 d-fugao-30 " :style="[{'background-color': fenggeyanse =='light'? '#f3f4f7':'#000000','border-radius': '20px 20px 0 0'}]">
		<view class="d-kuan d-fugao-50 " style="">
			<view class="d-neikuang-10 d-buhuanhang">
				<!--头像-->
				<view class="d-gaokuang-40 d-kuanggao-70 d-yuanjiao-40 d-zuo-10" >
					<image v-if="gerenxinxi" :src="gerenxinxi.avatar" mode="aspectFill" class="d-img-70 d-yuanjiao-50 d-beijing-hui"></image>
					<image v-else src="/static/assets/images/avatar.png" mode="aspectFill" class="d-img-70 d-yuanjiao-50 d-beijing-hui"></image>
					<!--image src="/static/assets/images/avatar.png" mode="aspectFill" class="d-img-40 d-yuanjiao-50 d-beijing-hui"></image-->
				</view>
				
				<view class="d-kuan d-zuo-10">
					<view class="d-wenzi-14 d-jiacu  d-wenzi-hei">{{gerenxinxi.name}}</view>
					<view class="d-wenzi-14 d-wenzi-yanse-bai-0 ">ID：{{gerenxinxi.uid}}</view>
				</view>
				
				<view v-if="ishaoyou.zhuangtai ==10" class="d-kuan-80 d-neirong-you d-you-10">
					<u-icon name="plus-circle" color="#c4c6c8" size="30" @click="getDenglu()"></u-icon>
				</view>
				<view v-else-if="faxinuid == touid" class="d-you-10">
					<view  class="d-kuan-80 d-neirong-you" @click="Duanxin(gerenxinxi.uid,faxinuid)">
						<image src="/static/images/sixin.png" class="d-img-28"></image>
					</view>
				</view>
				<view v-else class="d-you-10">
					<view v-if="ishaoyou.zhuangtai ==11" class="d-kuan-80 d-neirong-you">
						<u-icon name="plus-circle" color="#c4c6c8" size="30" @click="postHujiadata()"></u-icon>
					</view>
					<view v-else-if="ishaoyou.zhuangtai ==0" class="d-kuan-80 d-neirong-you">
						<u-icon name="clock" color="#ff5500" size="30" @click="getHaoyouhedui()"></u-icon>
					</view>
					<view v-else-if="ishaoyou.zhuangtai ==6" class="d-kuan-80 d-neirong-you">
						<u-icon name="plus-people-fill" color="#ff5500" size="30" @click="postRenzhenghaoyou(1)"></u-icon>
					</view>
					<view v-else-if="ishaoyou.zhuangtai ==1" class="d-kuan-80 d-neirong-you">
						<image src="/static/images/sixin.png" class="d-img-28" @click="Duanxin(gerenxinxi.uid,faxinuid)"></image>
					</view>
				</view>

			</view>
		</view>
		<view class="d-clear"></view>
	</view>
	
    <!--左边-->
	<view class="d-kuan-pc">
		<!--左边PC-->
		<!-- #ifdef H5 -->
		<view class="d-xianshi-pc d-kuan-pc-25 d-zuo">
			
		</view>
		<!-- #endif -->
		<!--中间 H5-->
		<view class="d-kuan-pc-50-100">
			<view class="d-kuan">
				<view class="d-waikuang-10">
					<view class="d-kuan d-yuanjiao-10">
						<!--头像-->
						<!--view class="d-neikuang-10 d-buhuanhang">
							
							<view class="d-gaokuang-40 d-kuanggao-40 d-yuanjiao-40 " @click="D_post_uptouxiang">
								<image v-if="gerenxinxi" :src="gerenxinxi.avatar" mode="aspectFill" class="d-img-40 d-yuanjiao-50 d-beijing-hui"></image>
								<image v-else src="/static/assets/images/avatar.png" mode="aspectFill" class="d-img-40 d-yuanjiao-50 d-beijing-hui"></image>
								
							</view>
							
							<view class="d-kuan d-zuo-10">
								<view class="d-wenzi-14 d-jiacu">{{gerenxinxi.name}}</view>
								<view class="d-wenzi-14 d-wenzi-yanse-hui">ID：{{gerenxinxi.uid}}</view>
							</view>
							
							<view v-if="ishaoyou.zhuangtai ==10" class="d-kuan-80 d-neirong-you">
								<u-icon name="plus-circle" color="#c4c6c8" size="30" @click="getDenglu()"></u-icon>
							</view>
							<view v-else-if="faxinuid == touid">
								<view  class="d-kuan-80 d-neirong-you" @click="Duanxin(gerenxinxi.uid,faxinuid)">
									<image src="/static/images/sixin.png" class="d-img-28"></image>
								</view>
							</view>
							<view v-else>
								<view v-if="ishaoyou.zhuangtai ==11" class="d-kuan-80 d-neirong-you">
									<u-icon name="plus-circle" color="#c4c6c8" size="30" @click="postHujiadata()"></u-icon>
								</view>
								<view v-else-if="ishaoyou.zhuangtai ==0" class="d-kuan-80 d-neirong-you">
									<u-icon name="clock" color="#ff5500" size="30" @click="getHaoyouhedui()"></u-icon>
								</view>
								<view v-else-if="ishaoyou.zhuangtai ==6" class="d-kuan-80 d-neirong-you">
									<u-icon name="plus-people-fill" color="#ff5500" size="30" @click="postRenzhenghaoyou(1)"></u-icon>
								</view>
								<view v-else-if="ishaoyou.zhuangtai ==1" class="d-kuan-80 d-neirong-you">
									<image src="/static/images/sixin.png" class="d-img-28" @click="Duanxin(gerenxinxi.uid,faxinuid)"></image>
								</view>
							</view>
							
							
							
						</view-->
					</view>
				</view>
			</view>
			<!--关注-->
			<view class="d-kuan">
				<view class="d-waikuang-10 d-wenzi-hei">
					<view class="d-kuan d-yuanjiao-10">
						<view class="d-neikuang-10">
							<view class="d-kuan-25 d-zuo d-neirong-juzhong">
								<view class="d-jiacu">{{gerenxinxi.score}}</view>
								<view class="d-wenzi-14 d-wenzi-yanse-hui">成长值</view>
							</view>
							<view class="d-kuan-25 d-zuo d-neirong-juzhong">
								<view class="d-jiacu">{{gerenxinxi.guanzhu_count}}</view>
								<view class="d-wenzi-14 d-wenzi-yanse-hui">关注</view>
							</view>
							<view class="d-kuan-25 d-zuo d-neirong-juzhong">
								<view class="d-jiacu">{{gerenxinxi.fensi_count}}</view>
								<view class="d-wenzi-14 d-wenzi-yanse-hui">粉丝</view>
							</view>
							<view class="d-kuan-25 d-zuo d-neirong-juzhong">
								<view class="d-jiacu">{{gerenxinxi.tiezi_count}}</view>
								<view class="d-wenzi-14 d-wenzi-yanse-hui">动态</view>
							</view>
							<view class="d-clear"></view>
						</view>
					</view>
				</view>
			</view>

			<u-loading-icon text="加载中..." textSize="18" :show="jiazai" ></u-loading-icon>
			<!-- 列表template模板 -->
			<view class="d-yuanjiao-10">
				<view class="d-neikuang-zuoyou-6-shangxia-10">
					<u-row >
						<u-col span="4">
							<view  class="d-kuan d-buhuanhang">
							<u-icon class="d-shang-3" name="file-text" size="20"></u-icon> <view class="d-wenzi-hei"> 最新帖子</view>
							</view>
						</u-col>
						<u-col span="4">
							<view class="demo-layout bg-purple-light"></view>
						</u-col>
						<u-col span="4">
							<view v-if="fenggekaiguan == 0"  class="d-kuan">
							<view  class="d-kuan-40 d-you">
								<u-icon class="d-shang-3 d-you" name="list-dot" @click="fenggeshow = true" size="25"></u-icon>
							</view>
							</view>
						</u-col>
					</u-row>
				</view>
			</view>
			<u-picker
				:show="fenggeshow" 
				:columns="fenggevalue"
				:closeOnClickOverlay="true"
				title="选择风格"
				@cancel="fenggeshow = false"
				@confirm="fenggeshow = false"
				@change="fenggevalues"
			></u-picker>
			
			<view v-if="fengge == 2" >
				<Dwaterfall
				:dataList="postsList" 
				:column="columns" 
				@click="click" 
				@tiezi="tiezi"
				@getgeren="getgeren"
				@dianzan="dianzan"
				></Dwaterfall>
				<u-loading-icon text="加载中..." textSize="18" :show="xialajiazai" ></u-loading-icon>
				<view :style="'display:' + (isLoading?'block':'none')">
					<template is="tempLoading"></template>
				</view>
				<view class="loadingmore" :style="'display:' + floatDisplay">
					<view class="no-more" :hidden="!isLastPage">- 无更多文章 -</view>
				</view>
				<u-divider text="已经到底啦 !" v-if="daodi">{{daodi}}</u-divider>
				<!-- 版权信息template模板 -->
				<view class="copyright" :style="'display:' + floatDisplay">
					<block data-type="template" data-is="tempCopyright" data-attr="webSiteName:webSiteName,domain:domain">
						<view> {{webSiteName}} </view>
						<view> {{banbenhao}} </view>
					</block>
				</view>
			</view>
			<view v-else-if="fengge == 3" >
				<block v-for="(item, index) in postsList" :key="index">
					<view class="d-kuan d-xia-10 d-beijing-bai">
						<view class="d-waikuang-10">
							<view class="d-kuan d-yuanjiao-10 d-shangxia-neikuang-10">
								<view class="u-page ">
									<view class="u-demo-block ">
										<view class="u-demo-block__content">
											<view class="album">
												<view class="album__avatar d-yuanjiao-50">
													
													<view class="d-gaokuang-40 d-kuanggao-40 d-yuanjiao-40 d-box" @click="getgeren(item.uid)">
														<image v-if="item.touxiang" :src="item.touxiang" mode="aspectFill" class="d-img-40 d-yuanjiao-50 "></image>
														<image v-else src="/static/assets/images/avatar.png" mode="aspectFill" class="d-img-40 d-yuanjiao-50 "></image>
														<image v-if="item.rzs == 1" :src="v" mode="aspectFill" class="d-img-10 d-yuanjiao-50  d-box-xia"></image>
													</view>
												</view>
												<view class="album__content">
													
													<u--text
													  :text="item.mingcheng"
													  type=""
													  bold
													  size="16"
													></u--text>
													<view class="d-wenzi-14 d-wenzi-yanse-hui">{{item.yonghuzu}}. {{item.guishudi}}</view>
													<!--标题-->
													<view v-if="item.caiji && item.caiji.kaiguan ==1">
														<view
															v-if="item.title"
															class="d-jiacu d-shang-10 d-wenzi-16 d-xia-10 d-younei-10  d-wenzi-hei" 
															@click="tiezi(item.cid,item.id)"
														>{{item.title}}</view>
														<view class="d-kuan d-buhuanhang d-shang-10" @click="tiezi(item.cid,item.id)">
															<view class="d-img-caiji">
																<image :src="item.caiji && item.caiji.tu" mode="aspectFill" class="d-img-200 d-yuanjiao-6"></image>
															</view>
															<view class="d-zuo-10">
																{{item.caiji && item.caiji.jianjie}}
															</view>
														</view>
													</view>
													<view v-else>
														<view 
															v-if="item.title"
															class="d-jiacu d-shang-10 d-wenzi-16 d-xia-10 d-younei-10  d-wenzi-hei" 
															@click="tiezi(item.cid,item.id)"
														>{{item.title}}</view>
														<view 
															class=" d-wenzi-14 d-wenzi-huanhang d-wenzi-yanse-hui"
															@click="tiezi(item.cid,item.id)"
														>
															{{item.neirong}}
														</view>
													</view>
													<view <view v-if="item.caiji && item.caiji.kaiguan !=1">
														<u-album class="d-shang-10" singleSize="250" multipleSize="90" :previewFullImage="false" :urls="item.tuji"></u-album>
														<u-album class="d-shang-10" singleSize="250" multipleSize="90" :previewFullImage="false" :urls="item.jiugetu"></u-album>
													</view>
													<!--视频-->
													<view v-if="item.shipin && item.shipin.kaiguan == 1" class="d-shang-10">
														<video 
														class="d-yuanjiao-10 d-kuan"
														:src="item.shipin && item.shipin.url"
														controls>
														</video>
													</view>
													<!--音频-->
													<view v-if="item.mpsan && item.mpsan.kaiguan == 1" class="d-shang-10">
														<block v-for="(itemmp, indexmp) in  item.mpsan.mp" :key="indexmp">
															<sy-audio 
															isCountDown 
															:ref="'audio'+item.id+indexmp"
															:src='itemmp.url' 
															:audioCover='mpsantu' 
															subheading='' 
															:audioTitle='itemmp.title'
															:fenggeyanse="fenggeyanse"
															@audioPlay="audioPlay('audio'+item.id+indexmp)"
															@audioPause="audioPause"
															>
															</sy-audio>
															
															<!--view class="" @click="mpsanbofang(itemmp.title,itemmp.url)"> {{itemmp.title}}</view-->
														</block>
													</view>
													<!--u-divider text=""></u-divider-->
													<!--问答进度条-->
													<view v-if="item.wendakaiguan ==1" class="d-neikuang-10 d-shang-10  d-yuanjiao-10 " :style="[{'background-color': fenggeyanse =='light'? '#fff4f4':'#242424'}]" @click="tiezi(item.cid,item.id)">
														<u-divider-d
																text="问答求助"
																textColor="#cf1212"
																:lineColor="fenggeyanse =='light'? '#fff4f4':'#242424'"
																ico="chat"
																color="#cf1212"
														></u-divider-d>
													
														<u-steps :current="item.wenda" :beijing="fenggeyanse =='light'? '#fff4f4':'#242424'" :inactiveColor="fenggeyanse =='light'? '#ff9346':'#f5f5f5'" activeColor="#ff702e">
															<u-steps-item title="提问中" :desc="item.tiwentime"></u-steps-item>
															<u-steps-item title="已解答" :desc="item.yijietime"></u-steps-item>
														</u-steps>
														
													</view>
													<!--需求进度条-->
													<view v-if="item.xuqiukaiguan ==1" class="d-neikuang-10 d-shang-10  d-yuanjiao-10 " :style="[{'background-color': fenggeyanse =='light'? '#f5f9ff':'#242424'}]">
														<u-steps :current="item.xuqiu" :beijing="fenggeyanse =='light'? '#f5f9ff':'#242424'" :inactiveColor="fenggeyanse =='light'? '#adadad':'#f5f5f5'" :activeColor="fenggeyanse =='light'? '#39c9e5':'#39c9e5'">
															<u-steps-item title="提需求" :desc="item.tixuqiutime"></u-steps-item>
															<u-steps-item title="排期中" :desc="item.paixuqiutime"></u-steps-item>
															<u-steps-item title="在开发" :desc="item.kaifaxuqiutime"></u-steps-item>
															<u-steps-item title="已上线" :desc="item.wangchengxuqiutime"></u-steps-item>
														</u-steps>
													</view>
													<!--缺点修复进度-->
													<view v-if="item.bugkaiguan ==1" class="d-neikuang-10 d-shang-10  d-yuanjiao-10 " :style="[{'background-color': fenggeyanse =='light'? '#eefffa':'#242424'}]">
														<u-steps :current="item.bugs" :beijing="fenggeyanse =='light'? '#eefffa':'#242424'" activeColor="#5eb295" :inactiveColor="fenggeyanse =='light'? '#adadad':'#f5f5f5'">
															<u-steps-item title="发现BUG" :desc="item.tibugtime"></u-steps-item>
															<u-steps-item title="排期中" :desc="item.paixubugtime"></u-steps-item>
															<u-steps-item title="在开发" :desc="item.kaifabugtime"></u-steps-item>
															<u-steps-item title="已修复" :desc="item.wangchengbugtime"></u-steps-item>
														</u-steps>
													</view>
													<!--招聘-->
													<Dzhaopin
														v-if="item.zpkg ==1"
														:xinzis="item.xinzis"
														:zpyqs="item.zpyqs"
														:zhaopinbiao="item.zhaopinbiao"
														:zhaopintime="item.zhaopintime"
														:acid="item.cid"
														:aid="item.id"
														:diqua="item.diqua"
														:diqub="item.diqub"
														:diquc="item.diquc"
														:zprs="item.zprs"
														:fulilist="item.fulilist"
														:zhaopinhaoma="item.zhaopinhaoma"
														:liebiao="0"
														:keycode="keycode"
														:gongzuodizhi="item.gongzuodizhi"
														:fenggeyanse="fenggeyanse"
														@tiezi="tiezi"
													></Dzhaopin>
													<!--评论-->
													<view class="d-shang-10">
														<view class="d-wenzi-12 d-shang-10 d-kuan-baifen-50 d-zuo d-wenzi-yanse-hui">
															{{item.shijian}}
														</view>
														<view class="d-wenzi-12 d-kuan-baifen-50 d-zuo d-wenzi-yanse-hui">
															<view class="d-wenzi-12 d-kuan-baifen-50 d-zuo d-neirong-zuo d-buhuanhang d-shang-4" @click="tiezi(item.cid,item.id)">
																<!--image src="/static/images/img/xiaoxi3.png" class="d-img-25"></image-->
																<u-icon :label="item.comments" size="28" name="/static/images/img/xiaoxi3.png"></u-icon>
																
															</view>
															<view class="d-wenzi-12 d-kuan-baifen-50 d-zuo d-neirong-you" :id="'zan'+item.id">
																
																<image v-if="item.zanzhi == 1" src="/static/images/img/dianzan2.png" class="d-img-35" @click="dianzan(index,item.id)"></image>
																<image v-else src="/static/images/img/zan3.png" class="d-img-35" @click="dianzan(index,item.id)"></image>
																<!--u-icon size="35" name="/static/images/img/zan3.png"></u-icon-->
															</view>
														</view>
														<view class="d-clear"></view>
													</view>
												</view>
											</view>
										</view>
									</view>
								</view>
							</view>
						</view>
					</view>
				</block>
				<u-loading-icon text="加载中..." textSize="18" :show="xialajiazai" ></u-loading-icon>
				<view :style="'display:' + (isLoading?'block':'none')">
					<template is="tempLoading"></template>
				</view>
				<view class="loadingmore" :style="'display:' + floatDisplay">
					<view class="no-more" :hidden="!isLastPage">- 无更多文章 -</view>
				</view>
				<u-divider text="已经到底啦 !" v-if="daodi">{{daodi}}</u-divider>
				<!-- 版权信息template模板 -->
				<view class="copyright" :style="'display:' + floatDisplay">
					<block data-type="template" data-is="tempCopyright" data-attr="webSiteName:webSiteName,domain:domain">
						<view> {{webSiteName}} </view>
						<view> {{banbenhao}} </view>
					</block>
				</view>
			</view>
			<view v-else-if="fengge == 4" >
				<!--极简-->
				<block data-type="template" data-is="tempCommonList" data-attr="postsList:postsList,listAdsuccess:listAdsuccess">
					<block v-for="(item, index) in postsList" :key="index">
						<view class="d-kuan">
							<view class="d-waikuang-10">
								<view class="d-kuan d-beijing-bai d-yuanjiao-10">
									
									<view class="d-zuoyou-neikuang-10 d-buhuanhang d-shangxia-neikuang-10">
										<view class="d-kuan ">
											<!--标题-->
											<view v-if="item.caiji && item.caiji.kaiguan ==1">
												<view
													v-if="item.title"
													class="d-jiacu d-shang-10 d-wenzi-16  d-xia-10 d-younei-10  d-wenzi-hei" 
													@click="tiezi(item.cid,item.id)"
												>{{item.title}}</view>
												<view class="d-kuan d-buhuanhang d-xia-10" @click="tiezi(item.cid,item.id)">
													<view class="d-img-caiji">
														<image :src="item.caiji && item.caiji.tu" mode="aspectFill" class="d-img-200 d-yuanjiao-6"></image>
													</view>
													<view class="d-zuo-10">
														{{item.caiji && item.caiji.jianjie}}
													</view>
												</view>
											</view>
											<view v-else>
												<view 
												v-if="item.title"
												:class="{'d-jiacu': true,  'd-wenzi-16': true,  'd-xia-10': true,  '': quanzishuxing['kongge'] == 1, 'd-younei-10': true,  'd-wenzi-hei': true,}" 
												@click="tiezi(item.cid,item.id)"
												>{{item.title}}
												</view>
												<view 
												:class="{
												  'd-wenzi-14': true,  
												  'd-wenzi-huanhang': true,  
												  'd-wenzi-yanse-hui': true, 
												   'd-chaochu-2':true, 
												  '': quanzishuxing['kongge'] == 1,
												}"
												@click="tiezi(item.cid,item.id)">
													{{item.neirong}}
												</view>
											</view>
											<view class="d-buhuanhang d-shang-10">
												<!--头像-->
												<view class="d-yuanjiao-40 d-box" @click="getgeren(item.uid)">
													<image v-if="item.touxiang" :src="item.touxiang" mode="aspectFill" class="d-img-20 d-yuanjiao-50 d-beijing-hui"></image>
													<image v-else src="/static/assets/images/avatar.png" mode="aspectFill" class="d-img-20 d-yuanjiao-50 d-beijing-hui"></image>
												    
												</view>
												<view class="d-kuan d-zuo-10" @click="getgeren(item.uid)">
													<view class="d-wenzi-14 d-wenzi-yanse-hui-ca">{{item.mingcheng}}</view>
												</view>
												<view class="d-kuan d-neirong-you d-wenzi-yanse-hui-ca" :id="'guanzhu'+item.uid">
													<txet>{{item.shijiandate}}</txet>
												</view>
											</view>
										</view>
										<view v-if="item.tuji">
											<view class="d-kuan-90 d-zuo-10" v-if="item.caiji && item.caiji.kaiguan !=1 ">
												<view >
													<!--帖子内容图片-->
													<view class="d-fu-kuan-10" @click="tiezi(item.cid,item.id)">
																			
														<view v-if="item.getu ==1">
															<block v-for="(itemtu, indextu) in item.tuji" :key="indextu">
																<view class="d-zuo d-liangbian-10" v-if="indextu == 0">
																	<image :src="itemtu" mode="aspectFill" class="d-img-100-baihua d-yuanjiao-6 d-yinying-10 d-img-anhei"></image>
																</view>
															</block>
														</view>
														<view v-else>
															<block v-for="(itemtu, indextu) in item.tuji" :key="indextu">
																<view class="d-zuo d-liangbian-10" v-if="indextu == 0">
																	<image :src="itemtu" mode="aspectFill" class="d-img-100-baihua d-yuanjiao-6 d-yinying-10 d-img-anhei"></image>
																</view>
															</block>
														</view>
														
														<view class="d-clear"></view>
													</view>
													<view class="d-clear"></view>
												</view>
											</view>
										</view>
										
			
									</view>
								</view>
								
							</view>
						</view>
					</block>
				</block>
				<u-loading-icon text="加载中..." textSize="18" :show="xialajiazai" ></u-loading-icon>
				<view :style="'display:' + (isLoading?'block':'none')">
					<template is="tempLoading"></template>
				</view>
				<view class="loadingmore" :style="'display:' + floatDisplay">
					<view class="no-more" :hidden="!isLastPage">- 无更多文章 -</view>
				</view>
				<u-divider text="已经到底啦 !" v-if="daodi">{{daodi}}</u-divider>
				<!-- 版权信息template模板 -->
				<view class="copyright" :style="'display:' + floatDisplay">
					<block data-type="template" data-is="tempCopyright" data-attr="webSiteName:webSiteName,domain:domain">
						<view> {{webSiteName}} </view>
						<view> {{banbenhao}} </view>
					</block>
				</view>
			</view>
			<view v-else class="d-kuan">
			
				<block data-type="template" data-is="tempCommonList" data-attr="postsList:postsList,listAdsuccess:listAdsuccess">
					<block v-for="(item, index) in postsList" :key="index">
						<view class="d-kuan">
							<view class="d-waikuang-10">
								<view class="d-kuan d-beijing-bai d-yuanjiao-10">
									<view class="d-neikuang-10 d-buhuanhang">
										<!--头像-->
										<view class="d-gaokuang-40 d-kuanggao-40 d-yuanjiao-40 d-box" >
											<image v-if="item.touxiang" :src="item.touxiang" mode="aspectFill" class="d-img-40 d-yuanjiao-50 d-beijing-hui"></image>
											<image v-else src="/static/assets/images/avatar.png" mode="aspectFill" class="d-img-40 d-yuanjiao-50 d-beijing-hui"></image>
										<image v-if="item.rzs == 1" :src="v" mode="aspectFill" class="d-img-10 d-yuanjiao-50 d-beijing-hui d-box-xia"></image>
										</view>
										<view class="d-kuan d-zuo-10">
											<view class="d-wenzi-14 d-jiacu  d-wenzi-hei">{{item.mingcheng}}</view>
											<view class="d-wenzi-14 d-wenzi-yanse-hui">{{item.yonghuzu}}. {{item.guishudi}}</view>
										</view>
										<view class="d-kuan-80 d-neirong-you" :id="'guanzhu'+item.uid">
											<view v-if="item.guanzhuuid == 1" @click="getGuanzhus(index,item.uid)" class="d-kuan-40 d-beijing-hei d-wenzi-yanse-bai-0 d-neikuang-zuoyou-2-shangxia-4 d-wenzi-12 d-yuanjiao-50 d-neirong-juzhong" >已关注</view>
											<view v-else @click="getGuanzhus(index,item.uid)" class="d-kuan-40 d-beijing-hui-f6 d-wenzi-hei d-neikuang-zuoyou-2-shangxia-4 d-wenzi-12 d-yuanjiao-50 d-neirong-juzhong" >关 注</view>
										</view>
									</view>
									<view class="d-zuoyou-neikuang-10 ">
										<!--标题-->
										<view v-if="item.caiji && item.caiji.kaiguan ==1">
											<view
												v-if="item.title"
												class="d-jiacu d-shang-10 d-wenzi-16 d-xia-10 d-younei-10  d-wenzi-hei" 
												@click="tiezi(item.cid,item.id)"
											>{{item.title}}</view>
											<view class="d-kuan d-buhuanhang" @click="tiezi(item.cid,item.id)">
												<view class="d-img-caiji">
													<image :src="item.caiji && item.caiji.tu" mode="aspectFill" class="d-img-200 d-yuanjiao-6"></image>
												</view>
												<view class="d-zuo-10">
													{{item.caiji && item.caiji.jianjie}}
												</view>
											</view>
										</view>
										<view v-else>
											<view 
											v-if="item.title"
											:class="{'d-jiacu': true,  'd-wenzi-16': true,  'd-xia-10': true,  'd-zuonei-50': quanzishuxing['kongge'] == 1, 'd-younei-10': true,  'd-wenzi-hei': true,}" 
											@click="tiezi(item.cid,item.id)"
											>{{item.title}}
											</view>
											<view 
											:class="{
											  'd-wenzi-14': true,  
											  'd-wenzi-huanhang': true,  
											  'd-wenzi-yanse-hui': true,  
											  'd-qiankong-50': quanzishuxing['kongge'] == 1,
											}"
											@click="tiezi(item.cid,item.id)">
												{{item.neirong}}
											</view>
										</view>
										<!--视频-->
										<view v-if="item.shipin && item.shipin.kaiguan == 1" class="d-shang-10">
											<video 
											class="d-yuanjiao-10 d-kuan"
											:src="item.shipin.url"
											controls>
											</video>
										</view>
										<!--音频-->
										<view v-if="item.mpsan && item.mpsan.kaiguan == 1" class="d-shang-10">
											<block v-for="(itemmp, indexmp) in  item.mpsan.mp" :key="indexmp">
												<sy-audio 
												isCountDown 
												:ref="'audio'+item.id+indexmp"
												:src='itemmp.url' 
												:audioCover='mpsantu' 
												subheading='' 
												:audioTitle='itemmp.title'
												:fenggeyanse="fenggeyanse"
												@audioPlay="audioPlay('audio'+item.id+indexmp)"
												@audioPause="audioPause"
												>
												</sy-audio>
												
												<!--view class="" @click="mpsanbofang(itemmp.title,itemmp.url)"> {{itemmp.title}}</view-->
											</block>
										</view>
										<view <view v-if="item.caiji && item.caiji.kaiguan !=1">
										<!--帖子内容图片-->
											<view class="d-fu-kuan-10" @click="tiezi(item.cid,item.id)">
												<view v-if="item.getu ==1">
													<block v-for="(itemtu, indextu) in item.tuji" :key="indextu">
														<view class="d-kuan-30 d-zuo d-liangbian-10" v-if="indextu < 3">
															<image :src="itemtu" mode="aspectFill" class="d-img-100-bai d-yuanjiao-6 d-yinying-10 d-img-anhei"></image>
														</view>
													</block>
												</view>
												<view v-else>
													<block v-for="(itemtu, indextu) in item.tuji" :key="indextu">
														<view class="d-kuan-30 d-zuo d-liangbian-10" v-if="indextu < 9">
															<image :src="itemtu" mode="aspectFill" class="d-img-100-bai d-yuanjiao-6 d-yinying-10 d-img-anhei"></image>
														</view>
													</block>
												</view>
												<view class="d-clear"></view>
											</view>
											<!--帖子九格图片-->
											<view class="d-fu-kuan-10" @click="tiezi(item.cid,item.id)">
												<block v-for="(itemtu, indextu) in item.jiugetu" :key="indextu">
													<view class="d-kuan-30 d-zuo d-liangbian-10" v-if="indextu < 8">
														<image :src="itemtu" mode="aspectFill" class="d-img-100-bai d-yuanjiao-6 d-yinying-10"></image>
													</view>
												</block>
												<view class="d-clear"></view>
											</view>
										</view>
										<view class="d-clear"></view>
										<!--问答进度条-->
										<view v-if="item.wendakaiguan ==1" class="d-neikuang-10 d-shang-10  d-yuanjiao-10 " :style="[{'background-color': fenggeyanse =='light'? '#fff4f4':'#242424'}]" @click="tiezi(item.cid,item.id)">
											<u-divider-d
													text="问答求助"
													textColor="#cf1212"
													:lineColor="fenggeyanse =='light'? '#fff4f4':'#242424'"
													ico="chat"
													color="#cf1212"
											></u-divider-d>
										
											<u-steps :current="item.wenda" :beijing="fenggeyanse =='light'? '#fff4f4':'#242424'" :inactiveColor="fenggeyanse =='light'? '#ff9346':'#f5f5f5'" activeColor="#ff702e">
												<u-steps-item title="提问中" :desc="item.tiwentime"></u-steps-item>
												<u-steps-item title="已解答" :desc="item.yijietime"></u-steps-item>
											</u-steps>
											
										</view>
										<!--需求进度条-->
										<view v-if="item.xuqiukaiguan ==1" class="d-neikuang-10 d-shang-10  d-yuanjiao-10 " :style="[{'background-color': fenggeyanse =='light'? '#f5f9ff':'#242424'}]">
											<u-steps :current="item.xuqiu" :beijing="fenggeyanse =='light'? '#f5f9ff':'#242424'" :inactiveColor="fenggeyanse =='light'? '#adadad':'#f5f5f5'" :activeColor="fenggeyanse =='light'? '#39c9e5':'#39c9e5'">
												<u-steps-item title="提需求" :desc="item.tixuqiutime"></u-steps-item>
												<u-steps-item title="排期中" :desc="item.paixuqiutime"></u-steps-item>
												<u-steps-item title="在开发" :desc="item.kaifaxuqiutime"></u-steps-item>
												<u-steps-item title="已上线" :desc="item.wangchengxuqiutime"></u-steps-item>
											</u-steps>
										</view>
										<!--缺点修复进度-->
										<view v-if="item.bugkaiguan ==1" class="d-neikuang-10 d-shang-10  d-yuanjiao-10 " :style="[{'background-color': fenggeyanse =='light'? '#eefffa':'#242424'}]">
											<u-steps :current="item.bugs" :beijing="fenggeyanse =='light'? '#eefffa':'#242424'" activeColor="#5eb295" :inactiveColor="fenggeyanse =='light'? '#adadad':'#f5f5f5'">
												<u-steps-item title="发现BUG" :desc="item.tibugtime"></u-steps-item>
												<u-steps-item title="排期中" :desc="item.paixubugtime"></u-steps-item>
												<u-steps-item title="在开发" :desc="item.kaifabugtime"></u-steps-item>
												<u-steps-item title="已修复" :desc="item.wangchengbugtime"></u-steps-item>
											</u-steps>
										</view>
										<!--招聘-->
										<Dzhaopin
											v-if="item.zpkg ==1"
											:xinzis="item.xinzis"
											:zpyqs="item.zpyqs"
											:zhaopinbiao="item.zhaopinbiao"
											:zhaopintime="item.zhaopintime"
											:acid="item.cid"
											:aid="item.id"
											:diqua="item.diqua"
											:diqub="item.diqub"
											:diquc="item.diquc"
											:zprs="item.zprs"
											:fulilist="item.fulilist"
											:zhaopinhaoma="item.zhaopinhaoma"
											:liebiao="0"
											:keycode="keycode"
											:gongzuodizhi="item.gongzuodizhi"
											:fenggeyanse="fenggeyanse"
											@tiezi="tiezi"
										></Dzhaopin>
										<!--评论-->
										<view class="d-shangxia-neikuang-10">
											<view class="d-wenzi-12 d-kuan-baifen-50 d-zuo d-wenzi-yanse-hui">
												{{item.shijian}}
											</view>
											<view class="d-wenzi-12 d-kuan-baifen-50 d-zuo d-wenzi-yanse-hui">
												<view class="d-wenzi-12 d-kuan-baifen-50 d-zuo d-neirong-zuo d-buhuanhang d-shang-4" @click="tiezi(item.cid,item.id)">
													<!--image src="/static/images/img/xiaoxi3.png" class="d-img-25"></image-->
													<u-icon :label="item.comments" size="28" name="/static/images/img/xiaoxi3.png"></u-icon>
													
												</view>
												<view class="d-wenzi-12 d-kuan-baifen-50 d-zuo d-neirong-you" :id="'zan'+item.id">
			
													<image v-if="item.zanzhi == 1" src="/static/images/img/dianzan2.png" class="d-img-35" @click="dianzan(index,item.id)"></image>
													<image v-else src="/static/images/img/zan3.png" class="d-img-35" @click="dianzan(index,item.id)"></image><!--{{item.zanzhi}}-->
													<!--u-icon size="35" name="/static/images/img/zan3.png"></u-icon-->
												</view>
											</view>
											<view class="d-clear"></view>
										</view>
										
									</view>
								</view>
								<!--评论-->
								<view class="">
									
								</view>
							</view>
						</view>
					</block>
				</block>
				<u-loading-icon text="加载中..." textSize="18" :show="xialajiazai" ></u-loading-icon>
				<view :style="'display:' + (isLoading?'block':'none')">
					<template is="tempLoading"></template>
				</view>
				<view class="loadingmore" :style="'display:' + floatDisplay">
					<view class="no-more" :hidden="!isLastPage">- 无更多文章 -</view>
				</view>
				<u-divider text="已经到底啦 !" v-if="daodi">{{daodi}}</u-divider>
				<!-- 版权信息template模板 -->
				<view class="copyright" :style="'display:' + floatDisplay">
					<block data-type="template" data-is="tempCopyright" data-attr="webSiteName:webSiteName,domain:domain">
						<view> {{webSiteName}} </view>
						<view> {{banbenhao}} </view>
					</block>
				</view>
			</view>
			
			
			<!-- 无法访问网络 -->
			<view class="showerror" :style="'display:' + showerror">
				<!--image src="/static/images/cry80.png" style="height:100rpx;width:100rpx"></image-->
				<view class="errortext">
					暂时无法访问网络，下拉重试...
				</view>
			</view>
			<privacy ref="privacy" type="bottom" :refuse="refuse" />
				<scroll-view class="uni-body" scroll-y="true"></scroll-view>
		</view>
		<!--右边PC端-->
		<!-- #ifdef H5 -->
		<view class="d-xianshi-pc d-kuan-pc-25 d-zuo">
			
		</view>
		<!-- #endif -->
	
	</view>
	<!--背景图-->
	<u-popup :show="show"  mode="top" @close="close" @open="open" >
		<view class="d-kuan">
			<view class="d-neikuang-10">
				<view class="d-xia-10">上传背景图片</view>
				<view class="d-juzhong">
					<u-upload
							:fileList="fileList1"
							@afterRead="afterRead"
							@delete="deletePic"
							name="1"
							multiple
							:maxCount="1"
						></u-upload>
				</view>
				
			</view>
		</view>
	</u-popup>
</view>
</template>

<script>
import privacy from "@/components/privacy/privacy";  //引入头部组件
import toubu from "@/components/toubu/toubu";  //引入头部组件
import Dwaterfall  from "@/components/d-waterfall/d-waterfall";  //引入组件
import Dzhaopin from "@/components/d-zhaopin/d-zhaopin";  //引入组件

var Api = require("../../utils/api.js");
var util = require("../../utils/util.js");
var wxApi = require("../../utils/wxApi.js");
var wxRequest = require("../../utils/wxRequest.js");
import config from "../../utils/config";
var pageCount = config.getPageCount;
var webSiteName = config.getWebsiteName;
var domain = config.getDomain;
var topNav = config.getIndexNav;
var banbenhao = config.getDuixinbanbenhao;


//var uid = uni.getStorageSync('memberuid');

export default {
  data() {
    return {
      postsList: [],
	  tubiaoList: [],
      
      isLastPage: false,
      page: 1,
	  swiperheight: '',
	  swiperItemHeight: '',
      search: '',
      categories: 0,
      showerror: "none",
      showCategoryName: "",
      categoryName: "",
      showallDisplay: "block",
      displayHeader: "none",
      displaySwiper: "none",
      floatDisplay: "none",
      displayfirstSwiper: "none",
      topNav: topNav,
      webSiteName: webSiteName,
	  banbenhao: banbenhao,
      domain: domain,
	  jiazai:true,
      isFirst: false,
      // 是否第一次打开,
      isLoading: false,
	  //下载加载提示
	  xialajiazai: false,
	  www: [],
	  //到底
	  daodi: false,
	  scrollTop:'',
	  uid:'',
	  zanzhi: false,
	  userInfo:'',
	  qiandao: '',
	  yiqiandao: '',
	  gerenxinxi:{},
	  guid:'',
	  faxinuid:'',
	  //下载加载提示
	  xialajiazai: false,
	  //到底
	  daodi: false,
	  v:config.getDomain+'/static/default/web/img/V.png',
	  mpsantu:config.getDomain+'/static/default/web/img/mpsan.png',
	  banbenhao:banbenhao,
	  fengge: '',
	  columns:2,
	  fenggeshow: false,
	  fenggevalue: [
	              ['综合型', '瀑布图', '简约型','极简型']
	          ],
	  fenggezhi:'',
	  fenggemoren:'',
	  fenggekaiguan: '',
	  touid:'',
	  ishaoyou:{},
	  bgColor: '',
	  keycode:'',
	  fenggeyanse:'',
	  quanzishuxing:[],
	  show:false,
	  getbeijingtu:[],
	  fileList1:[],
	  fabuid:{},
	  uptu:[],
    };
  },
  components: {
  	  toubu,
  	  Dwaterfall,
	  Dzhaopin
  },
	mounted() {
		let _this = this
		if (uni.getPrivacySetting){
		    uni.getPrivacySetting({
		        success: (res) => {
		            //console.log("getPrivacySetting",res)
		            if (res.needAuthorization){
		                _this.$refs.privacy.open()
		            }
		
		            // 返回结果为: res = { needAuthorization: true/false, privacyContractName: '《xxx隐私保护指引》' }
		        },
		        fail: () => {},
		        complete:() => {}
		    })
		}
		
	},



  props: {},

  onPageScroll: function (e) {
	  var duixin = this;
	  var yanse = e.scrollTop;
	  if(yanse == 0) {
	  	duixin.bgColor = 'rgba(0, 0, 0, 0)';
	  } else if(yanse > 150){
	  	if(this.fenggeyanse =='light'){
	  		duixin.bgColor = 'rgba(255 255 255)';
	  	} else {
	  		duixin.bgColor = 'rgba(0, 0, 0, 1)';
	  	}
	  }
	  //console.log("yanse",duixin.bgColor);
  },
  onPullDownRefresh: function () {
    var self = this;
    self.setData({
      showerror: "none",
      showallDisplay: "block",
      displaySwiper: "none",
      floatDisplay: "none",
      isLastPage: false,
      page: 1,
      
    });

    this.fetchPostsData(self);
  },
  onReachBottom: function () {
    var self = this;
    if (!self.isLastPage) {
      self.setData({
        page: self.page + 1,
		xialajiazai: true,
      });
	  //console.log('当前页xialajiazai', self.xialajiazai);
      //console.log('当前页' + self.page);
      this.fetchPostsData(self);
    } else {
      //console.log('最后一页');
    }
  },
	onLoad: function (options,event) {

		this.$nextTick(() => {
			
		});
		var duixin = this;
		duixin.getDangqianurl();//获取当前网址
		var self = this;
		var guid = options.uid;
		duixin.getmybeijingtu(guid);
		var touid = options.uid;
	    self.guid = guid;
		self.touid = touid;
		 // 判断用户是不是第一次打开，弹出添加到我的小程序提示
		 duixin.getFabuid();

		var isFirstStorage = uni.getStorageSync('isFirst'); // console.log(isFirstStorage);

		if (!isFirstStorage) {
		  self.setData({
			isFirst: true
		  });
		  uni.setStorageSync('isFirst', 'no'); // console.log(uni.getStorageSync('isFirst'));
		  setTimeout(function () {
			self.setData({
			  isFirst: false
			});
		  }, 5000);
		}
		var userInfo = uni.getStorageSync('userInfo');
		var keycode = uni.getStorageSync('keycode');
		duixin.getQuanzishuxingData();
		//duixin.getmybeijingtu();
		self.userInfo = userInfo;
		self.keycode = keycode;
		//console.log("userInfo1",userInfo);
		if (userInfo) {
			self.showuid = true;
			var member = uni.getStorageSync('member');
			var uid = uni.getStorageSync('memberuid');
			self.uid = uid;
			self.faxinuid = uid;
			//console.log("member1",self.uid);
			//console.log("userInfo1",userInfo);
			self.fetchPostsData(self);
			
		} else {
			self.uid = '';
			self.fetchPostsData(self);
		}
		self.getIshaoyoudata();
		this.getWww();
		
		self.getGerenxinxi();
		

	},
	//分享给单独微信
	onShareAppMessage: function () {
	  return {
	    title: '“' + webSiteName + '”小程序',
	    path: 'pages/u/index?uid='+this.touid,
	    success: function (res) {// 转发成功
	    },
	    fail: function (res) {// 转发失败
	    }
	  };
	},
	//分享到朋友圈
	onShareTimeline: function () {
		  return {
		    title: '“' + webSiteName + '”小程序',
		    path: 'pages/u/index?uid='+this.touid,
		    success: function (res) {// 转发成功
		    },
		    fail: function (res) {// 转发失败
		    }
		  };
	},
    onShow() {
      uni.setStorageSync('openLinkCount', 0);
      var nowDate = new Date();
      nowDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + '-' + nowDate.getDate();
      nowDate = new Date(nowDate).getTime();
	  var duixin = this;
	    // 暗黑模式
	  var initialThemes = uni.getStorageSync('theme');
	  duixin.fenggeyanse = initialThemes;
	  uni.setNavigationBarColor({
	  	backgroundColor: this.fenggeyanse =='light'? '#ffffff':'#151515',
	  	frontColor: this.fenggeyanse =='light'? '#000000':'#ffffff',
	  })
    },
	onReady() {
		/*this.$nextTick(() => {
		uni.createSelectorQuery().in(this).select('.swiper-item').boundingClientRect(data => {
		console.log("高度1"+data);
		}).exec()
		});*/ 
	},
	onUnload: function () {
		this.audioDestroy();
		console.log('销毁');
	},
	onHide: function ()  {
		this.audioDestroy()
	},
    methods: {
		audioDestroy(){
			const refNames = Object.keys(this.$refs);
			// 过滤出引用名为"bbb"和"ccc"的组件  refName !== 'ccc125' !/`event`|privacy|hbComment/.test(refName)
			const filteredRefs = refNames.filter(refName => refName !== 'privacy' && refName !== 'hbComment' && refName !== 'audio');  
			//console.log('refNames',filteredRefs);
			// 循环遍历引用名称  
			filteredRefs.forEach((refName) => {  
			  // 获取对应的引用对象（即子组件实例）
			  this.$refs[refName][0].zanting(0);
			  
			  // 在这里可以对refObject进行操作，例如调用方法或访问数据属性等  
			  //console.log(refName, refObject);  
			});
			console.log('销毁');
			
		},
		fanhui() {
			const pages = getCurrentPages();  //判断跳转了多少页
			if (pages.length === 2) {  
				uni.navigateBack({
					delta: 1
				});
			} else if (pages.length === 1) { //如果没有上一页返回首页
				uni.switchTab({
					url: '/pages/index/index',
				})
			} else {
				uni.navigateBack({
					delta: 1
				});
			}
		},
		connectGoEasy(data) {
			var duixin = this;
		  uni.showLoading();
		  console.log('datad5555',data)
		  duixin.goEasy.connect({
		    id: data.id,
		    data: {
		      name: data.name,
		      avatar: data.avatar
		    },
		    onSuccess: () => {
		      console.log('im链接成功.')
		    },
		    onFailed: (error) => {
		      console.log('Failed to connect GoEasy, code:' + error.code + ',error:' + error.content);
		    },
		    onProgress: (attempts) => {
		      console.log('GoEasy is connecting', attempts);
		    }
		  });
		},
		onScroll(e) {
			//console.log('gaogaogaogao:', e.detail);
			      // 可以将滚动高度保存到 data 中，便于在其它地方使用
			this.scrollTop = e.detail.scrollTop
		},
		//内容帖子
		tiezi(quanid,tieid) {
			// console.log('查看帖子');
			var url = '../tiezi/tiezi?qid='+quanid+'&id='+tieid;
			uni.navigateTo({
				url: url
			});
		},
		refuse() {
		    // this.$refs.privacy.open()
		    uni.showToast({
		        icon: 'none',
		        title: '非常抱歉无法为您提供服务，如需服务请先同意相关协议~',
				   duration: 3000
		    });
		    return
		},
		getWww() {
			var self = this;
			self.setData({
			  www: []
			});
			var uid = self.userInfo;
			console.log('uid',uid); 

			var getTubiaoRequest = wxRequest.getRequest(Api.getWwwUrl(uid,self.uid,self.userInfo));
			getTubiaoRequest.then(response => {
				if (response.data.code == 1) {
				  //console.log(response.data.data); 
				  self.www = response.data.data
				} else {
					if(response.data.msg=="账号必须实名认证"){
						uni.showModal({
							title: response.data.msg,
							//content: '请先登录',
							confirmText: '前往认证',
							success: function(res) {
								if (res.confirm) {
									uni.navigateTo({
										url: '/pages/shezhi/renzheng'
									});
								}
							}
						});
					} else {
						  self.setData({
							displaySwiper: "none"
						  });
					}
				}
			});
		},
		//个人信息
		getGerenxinxi() {
			var duixin = this;
			duixin.setData({
			  gerenxinxi: []
			});
			var uid = duixin.guid;
			var getYonghuXinxiRequest = wxRequest.getRequest(Api.getYonghuXinxi(uid));
			getYonghuXinxiRequest.then(response => {
				if (response.data.code == 1) {
				  //console.log('gerenxinxi',response.data.data); 
				  duixin.gerenxinxi = response.data.data
				  
				} else {
				  duixin.setData({
					displaySwiper: "none"
				  });
				}
			});
		},

		formSubmit: function (e) {
		  var url = '../list/list';
		  var key = '';
			 //console.log('earch');
			  if (e.currentTarget.id == "search-input") {
				key = e.detail.value;
			  } else {
				key = e.detail.value.input;
			  }

			  if (key != '') {
				url = url + '?search=' + key;
				uni.navigateTo({
				  url: url
				});
			  } else {
				uni.showModal({
				  title: '提示',
				  content: '请输入内容',
				  showCancel: false
				});
			  }
		},
		
		
		//获取列表数据
		fetchPostsData: function (data) {
		  var self = this;
		  if (!data) data = {};
		  if (!data.page) data.page = 1;
		  if (!data.categories) data.categories = 0;
		  if (!data.search) data.search = '';

		  if (data.page === 1) {
			self.setData({
			  postsList: []
			});
		  }

		  ;
		  self.setData({
			isLoading: true
		  });
	  
			var getPostsRequest = wxRequest.getRequest(Api.getGerenyemian(data,self.uid,self.userInfo,self.guid));
			getPostsRequest.then(response => {
				//console.log("列表",response.data.data);
			if (response.data.code == 1) {
				self.jiazai = false;
				self.xialajiazai = false;
				var fenggezhi = uni.getStorageSync('fenggezhi');
				if(fenggezhi) {
					self.fengge = fenggezhi;
				} else {
					self.fengge = response.data.data[0].fengge;
				}
				
				self.fenggekaiguan = response.data.data[0].fenggekaiguan;
				if (response.data.data.length) {
				  if (response.data.data.length < pageCount) {
					self.setData({
					  isLastPage: true,
					  isLoading: false,
					});
				  }
				  //console.log('当前页下',self.xialajiazai);
				  self.setData({
					floatDisplay: "block",
					postsList: self.postsList.concat(response.data.data.map(function (item) {
				
					  if (item.thumb == null || item.thumb == '') {
						item.thumb = "/static/images/logo700.png";
					  }

					  return item;
					}))
				  });
				  
				} else {
				  if (response.data.code == "rest_post_invalid_page_number") {
					self.setData({
					  isLastPage: true,
					  isLoading: false
					});

					uni.showToast({
					  title: '没有更多内容',
					  mask: false,
					  duration: 1500
					});
					
				  } else {
					// 隐藏提示
					uni.showToast({
					  title: response.data.message,
					  duration: 1500
					});
					uni.showToast({
					  title: '没有更多内容',
					  duration: 500
					});
					self.daodi = true;
					//console.log('没有了',self.daodi);
				  }
				}
			  }
			}).catch(function (response) {
			  if (data.page == 1) {
				self.setData({
				  showerror: "block",
				  floatDisplay: "none"
				});
			  } else {
				uni.showModal({
				  title: '加载失败',
				  content: '加载数据失败,请重试.',
				  showCancel: false
				});
				self.setData({
				  page: data.page - 1
				});
			  }
			}).finally(function (response) {
			  uni.hideLoading();
			  self.setData({
				isLoading: false
			  });
			  uni.stopPullDownRefresh();
			});
		},
		//加载分页
		loadMore: function (e) {
		  var self = this;

		  if (!self.isLastPage) {
			self.setData({
			  page: self.page + 1
			}); 
			//console.log('当前页' + self.data.page);

			this.fetchPostsData(self);
		  } else {
			uni.showToast({
			  title: '没有更多内容',
			  mask: false,
			  duration: 1000
			});
		  }
		},
		// 跳转至查看文章详情
		/*redictDetail: function (e) {
		  // console.log('查看文章');
		  var id = e.currentTarget.id,
		  url = '../detail/detail?id=' + id;
		  uni.navigateTo({
			url: url
		  });
		},*/
		//首页图标跳转
		onNavRedirect: function (e) {
		  var redicttype = e.currentTarget.dataset.redicttype;
		  var url = e.currentTarget.dataset.url == null ? '' : e.currentTarget.dataset.url;
		  var appid = e.currentTarget.dataset.appid == null ? '' : e.currentTarget.dataset.appid;
		  var extraData = e.currentTarget.dataset.extraData == null ? '' : e.currentTarget.dataset.extraData;

		  if (redicttype == 'apppage') {
			//跳转到小程序内部页面         
			uni.navigateTo({
			  url: url
			});
		  } else if (redicttype == 'webpage') //跳转到web-view内嵌的页面
			{
			  url = '../webpage/webpage?url=' + url;
			  uni.navigateTo({
				url: url
			  });
			} else if (redicttype == 'miniapp') //跳转到其他app
			{
			  uni.navigateToMiniProgram({
				appId: appid,
				envVersion: 'release',
				path: url,
				extraData: extraData,

				success(res) {// 打开成功
				},

				fail: function (res) {
				  //console.log(res);
				}
			  });
			}
		},
		// 跳转至查看小程序列表页面或文章详情页
		redictAppDetail: function (e) {
		  // console.log('查看文章');
		  var id = e.currentTarget.id;
		  var redicttype = e.currentTarget.dataset.redicttype;
		  var url = e.currentTarget.dataset.url == null ? '' : e.currentTarget.dataset.url;
		  var appid = e.currentTarget.dataset.appid == null ? '' : e.currentTarget.dataset.appid;

		  if (redicttype == 'detailpage') //跳转到内容页
			{
			  url = '../detail/detail?id=' + id;
			  uni.navigateTo({
				url: url
			  });
			}

		  if (redicttype == 'apppage') {
			//跳转到小程序内部页面         
			uni.navigateTo({
			  url: url
			});
		  } else if (redicttype == 'webpage') //跳转到web-view内嵌的页面
			{
			  url = '../webpage/webpage?url=' + url;
			  uni.navigateTo({
				url: url
			  });
			} else if (redicttype == 'miniapp') //跳转到其他app
			{
			  uni.navigateToMiniProgram({
				appId: appid,
				envVersion: 'release',
				path: url,

				success(res) {// 打开成功
				},

				fail: function (res) {
				  //console.log(res);
				}
			  });
			}
		},
		//返回首页
		redictHome: function (e) {
		  //console.log('查看某类别下的文章');  
		  var id = e.currentTarget.dataset.id,
			  url = '/pages/index/index';
		  uni.switchTab({
			url: url
		  });
		},
		//关注
		getGuanzhus(index,uid) {
			var duixin = this;
			var getGuanzhuRequest = wxRequest.getRequest(Api.getGuanzhu(duixin.uid,duixin.userInfo)+'&uid='+uid);
			var res;
			getGuanzhuRequest.then(response => {
				res = response;
				if(res.data.code) {
					if(res.data.data.status == 1) {
						this.postsList[index].guanzhuuid = 1;
						
						uni.showToast({
							title: res.data.msg,
							icon: 'success',
							duration: 2000
						});
						
					} else {
						this.postsList[index].guanzhuuid = 0;
						
						uni.showToast({
						  title: res.data.msg,
						  mask: false,
						  duration: 1000
						});
					}
					
				} else {
					uni.showToast({
						icon: 'none',
						title: res.data.msg+'关注提示'
					});
				}
			})
		},
		//点赞值
		dianzan(index,tieid) {
			var duixin = this;
			var getZanRequest = wxRequest.getRequest(Api.getZan(tieid,duixin.uid,duixin.userInfo));
			var res;
			getZanRequest.then(response => {
				res = response;
				if(res.data.code) {
					if(res.data.msg.status == 1) {
						if (this.postsList[index].zanzhi == 0) {
							this.postsList[index].zanzhi = 1;
							uni.showToast({
								title: res.data.msg.value+' '+res.data.msg.jifen,
								icon: 'success',
								duration: 2000
							});
						} else {
							this.postsList[index].zanzhi = 0;
							uni.showToast({
								title: res.data.msg.value+' '+res.data.msg.jifen,
								icon: 'success',
								duration: 2000
							});
						}
					} else {
						this.postsList[index].zanzhi = 0;
						uni.showToast({
							title: res.data.msg.value+' '+res.data.msg.jifen,
							icon: 'success',
							duration: 2000
						});
					}
				} else {
				  /*uni.showToast({
					icon: 'none',
					title: '获取失败，请稍后重试000'
				  });*/
				  uni.showModal({
				  	title: '请先登录',
				  	//content: '请先登录',
				  	confirmText: '前往登录',
				  	success: function(res) {
				  		if (res.confirm) {
				  			uni.redirectTo({
				  				url: '/pages/login/login'
				  			});
				  		}
				  	}
				  });
				  // uni.reLaunch({ url: '/pages/login/login'}) // 跳转到登录页
				}
			})
			//console.log("帖子index",index);
			//console.log("帖子tieid",tieid);
		},
		//获取当前页面
		getDangqianurl() {
			//获取当前页面栈的实例
			let pages = getCurrentPages();
			//获取当前页面
			let currentPage = pages[pages.length-1].$page.fullPath;
			let url = currentPage;
			uni.setStorageSync('dangqianUrl', url);
			//console.log("帖子url",url);
		},
		//跳转到热门remen / 跳转下方链接的方法switchTab
		dremen() {
			uni.navigateTo({
				url: '/pages/hot/hots' // 目标页面的路径
			});
		},
		//跳转到新帖
		dxintie() {
			uni.navigateTo({
				url: '/pages/hot/xintie' // 目标页面的路径
			});
		},
		//跳转到新评
		dxinping() {
			uni.navigateTo({
				url: '/pages/hot/xinping' // 目标页面的路径
			});
		},
		
		// 点击
		quanzi(tieid) {
			console.log('点击',tieid); 
			var url = '../quan/quanzi?&id='+tieid;
			uni.navigateTo({
				url: url
			});
		},
		// 短信
		Duanxin(uid,faxinuid) {
			//console.log('点击',uid);
			var duixin = this;
			var faxinuid = duixin.faxinuid;
			var guid = duixin.guid;
			if(faxinuid == guid){
				var url = '../xiaoxiye/duanxinuid?faxinuid='+faxinuid;
				uni.navigateTo({
					url: url
				});
			} else {
				var url = '../xiaoxiye/duixin?&uid='+uid+'&faxinuid='+faxinuid;
				uni.navigateTo({
					url: url
				});
			}
			
			
		},
		// 个人页面
		getgeren(uid) {
			console.log('uid点击',uid);
			var url = '##';
			uni.navigateTo({
				url: url
			});
		},
		fenggeclose(){
			this.fenggeshow = false
		},
		fenggeopen(){
			this.fenggeshow = true
		},
		fenggevalues(e){
			var duixin = this;
			duixin.fenggezhi = e.index+1;
			duixin.fengge = e.index+1;
			//console.log('duixin.fenggevalue', duixin.fenggezhi);
			uni.setStorageSync('fenggezhi', e.index+1);
			var StorageSync = uni.getStorageSync('fenggezhi', e.index+1);
			//console.log('StorageSync缓存值：', StorageSync);
			
		},
		//判断好友
		getIshaoyoudata(){
			var duixin = this;
			var getIshaoyouRequest = wxRequest.getRequest(Api.getIshaoyou(duixin.uid,duixin.keycode,duixin.touid));
			var res;
			getIshaoyouRequest.then(response => {
				res = response;
				if(res.data.code) {
					duixin.ishaoyou = res.data.data;

				}  else {
					if(res.data.msg=="账号必须实名认证"){
						uni.showModal({
							title: res.data.msg,
							//content: '请先登录',
							confirmText: '前往认证',
							success: function(res) {
								if (res.confirm) {
									uni.navigateTo({
										url: '/pages/shezhi/renzheng'
									});
								}
							}
						});
					} else {
						uni.showToast({
							icon: 'none',
							title: '获取失败，请稍后重试'
						});
					}
				}
			})
			
		},
		//判断好友核对
		getHaoyouhedui(){
			var duixin = this;
			var getIshaoyouRequest = wxRequest.getRequest(Api.getIshaoyou(duixin.uid,duixin.keycode,duixin.touid));
			var res;
			getIshaoyouRequest.then(response => {
				res = response;
				if(res.data.code) {
					duixin.ishaoyou = res.data.data;
					if(res.data.data.zhuangtai ==0) {
						uni.showToast({
							title: response.data.msg,
							icon: 'success',
							duration: 3000
						});
					}
				}  else {
					if(res.data.msg=="账号必须实名认证"){
						uni.showModal({
							title: res.data.msg,
							//content: '请先登录',
							confirmText: '前往认证',
							success: function(res) {
								if (res.confirm) {
									uni.navigateTo({
										url: '/pages/shezhi/renzheng'
									});
								}
							}
						});
					} else {
						uni.showToast({
							icon: 'none',
							title: '获取失败，请稍后重试'
						});
					}
				}
			})
			
		},
		//判断登录
		getDenglu(){
			var duixin = this;
			if(duixin.keycode){
				
			} else {
				uni.showModal({
					title: '请先登录',
					//content: '请先登录',
					confirmText: '前往登录',
					success: function(res) {
						if (res.confirm) {
							uni.redirectTo({
								url: '/pages/login/login'
							});
						}
					}
				});
			}
			
		},
		//加好友
		postHujiadata(){
			var duixin = this;
			var datas = "is_ajax=1&data[touid]="+duixin.touid;
			var postHujiaRequest = wxRequest.postRequest(Api.postHujia(duixin.uid,duixin.keycode,duixin.touid),datas);
				postHujiaRequest.then(response => {
					if (response.data.code == 1) {
					    uni.showToast({
					    	title: response.data.msg,
					    	icon: 'success',
					    	duration: 5000
					    });
						duixin.getIshaoyoudata();
					} else {
						uni.showToast({
							title: response.data.msg,
							icon: 'success',
							duration: 5000
						});
					}
				});
		},
		//认证加好友
		postRenzhenghaoyou(zt){
			var duixin = this;
			var datas = "is_ajax=1&data[touid]="+duixin.touid+"&data[zhuangtai]="+zt;
			var postRenzhenghaoyouRequest = wxRequest.postRequest(Api.postRenzhenghaoyou(duixin.uid,duixin.keycode,duixin.touid),datas);
			postRenzhenghaoyouRequest.then(response => {
				if (response.data.code == 1) {
				  
				  duixin.ishaoyou = response.data.data;
					// 保存用户信息到本地storage
					duixin.getHaoyouhedui();
					uni.showToast({
						title: response.data.msg,
						icon: 'success',
						duration: 5000
					});
				}
			});
		},
		audioPlay(event){
			let _this = this;
			//console.log('refs',event);
			// 获取$refs对象的所有属性（即引用名称）  
			const refNames = Object.keys(this.$refs);
			// 过滤出引用名为"bbb"和"ccc"的组件  refName !== 'ccc125' !/`event`|privacy|hbComment/.test(refName)
			const filteredRefs = refNames.filter(refName => refName !== 'privacy' && refName !== 'hbComment' && refName !== 'audio' && refName !== event);  
			//console.log('refNames',filteredRefs);
			// 循环遍历引用名称  
			filteredRefs.forEach((refName) => {  
			  // 获取对应的引用对象（即子组件实例）
			  this.$refs[refName][0].zanting(0);
			  //const refObject = this.$refs[refName][0]; 
			  // 在这里可以对refObject进行操作，例如调用方法或访问数据属性等  
			  //console.log(refName, refObject);  
			}); 
		
		},
		audioPause(e){
			console.log('audioPause',e);
		},
		// 圈子属性
		getQuanzishuxingData(){
			var duixin = this;
			//console.log('xx'); 
			var getQuanzishuxingRequest = wxRequest.getRequest(Api.getQuanzishuxing());
			getQuanzishuxingRequest.then(response => {
				if (response.data.code == 1) {
				  //console.log(response.data.data); 
				  duixin.quanzishuxing = response.data.data
				} else {
				  duixin.setData({
					displaySwiper: "none"
				  });
				}
			});
		},
		// 背景图
		getmybeijingtu(uid){
			var duixin = this;
			//console.log('背景图'); 
			var postUidbeijingtuRequest = wxRequest.getRequest(Api.postUidbeijingtu(uid));
			postUidbeijingtuRequest.then(response => {
				if (response.data.code == 1) {
				  //console.log(response.data.data); 
				  duixin.getbeijingtu = response.data.data
				} else {
				  duixin.setData({
					displaySwiper: "none"
				  });
				}
			});
			
		},
		mybeijingtu(){
			var duixin = this;
			duixin.show = true;
		},
		//发布id
		getFabuid(){
			
			var duixin = this;
			
			var getFabuidRequest = wxRequest.getRequest(Api.getFabuid());
			getFabuidRequest.then(response => {
				if (response.data.code == 1) {
					
				  duixin.fabuid = response.data.data;
				  
				} else {
				  duixin.setData({
					displaySwiper: "none"
				  });
				}
			});
		},
		// 删除图片
		deletePic(event) {
			this[`fileList${event.name}`].splice(event.index, 1)
		},
		// 新增图片
		async afterRead(event) {
			var duixin = this; 
			// 当设置 multiple 为 true 时, file 为数组格式，否则为对象格式
			console.log('event',event); 
			let lists = [].concat(event.file)
			let fileListLen = this[`fileList${event.name}`].length
			lists.map((item) => {
				this[`fileList${event.name}`].push({
					...item,
					status: 'uploading',
					message: '上传中'
				})
			})
			for (let i = 0; i < lists.length; i++) {
				const result = await this.uploadFilePromise(lists[i].url)
				const id = duixin.uptu.data.id;
				console.log('uptu',duixin.uptu.data.id); 
				let item = this[`fileList${event.name}`][fileListLen]
				this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
					status: 'success',
					message: '',
					url: result,
					id:id
				}))
				fileListLen++
				
			}
		},
		uploadFilePromise(url) {
			
			var self = this; 
			var duixin = this; 
			//console.log('fabuidjiugetu',duixin.fabuid && duixin.fabuid.jiugetu); 
			var uid = duixin.uid;
			var code = duixin.keycode; //duixin.uid,duixin.keycode,
			var uidtu = duixin.fabuid && duixin.fabuid.uidtu;
			return new Promise((resolve, reject) => {
				let a = uni.uploadFile({
					
					url: Api.postTupians(uid,code)+'&fid='+uidtu, //
					filePath: url,
					name: 'file_data',
					formData: {
						is_ajax:1
					},
					success: (res) => {
						var duixin = this; 
						duixin.uptu = JSON.parse(res.data);
						var uptu = JSON.parse(res.data);
						console.log('code',uptu);
						duixin.postbeijingtu(uptu.code);
						setTimeout(() => {
							resolve(res.data)
						}, 1000)
						
						
						//上传图片成功后，打开九格图的开关
						//duixin.jiugetukaiguan = 1;
						//console.log('图片开关返回报错：',duixin.jiugetukaiguan);
						}
				});
			})
		},
		postbeijingtu(tuid){
			var duixin = this;
			var datas = "is_ajax=1&databeijingtu="+tuid;
			var postUidbeijingtuRequest = wxRequest.postRequest(Api.postUidbeijingtu(duixin.guid,duixin.uid,duixin.keycode),datas);
			postUidbeijingtuRequest.then(response => {
				if (response.data.code == 1) {
				  //console.log(response.data.data); 
				  //duixin.getbeijingtu = response.data.data
				  duixin.getmybeijingtu(duixin.uid);
				} else {
				  duixin.setData({
					displaySwiper: "none"
				  });
				}
			});
		},
		close(){
			this.show = false
		},
		open(){
			
		}

		
		
    },
	computed: {
		backgroundStyle() {  
		    if (this.getbeijingtu && this.getbeijingtu.beijingtu) {  
		      return {  
		        backgroundImage: `url(${this.getbeijingtu && this.getbeijingtu.beijingtu})`,  
		        backgroundPosition: 'center'  
		      };  
		    } else {  
		      return {  
		        backgroundImage: `url(${this.domain}/static/default/web/img/beijing.png)`,  
		        backgroundPosition: 'center'  
		      };  
		    }  
		  }  
	},

};
</script>
<style lang="scss">

@import "./index.css";
	/*#ifdef H5*/
	.uni-page-head { display: none; }
	/*#endif*/
page {
	background-color: #ffffff;
}
.d-huanhang-f {
	display: flex;
	word-wrap: break-word;
}
.d-layout {
	height: 50px;
	border-radius: 4px;
}

.d-purple {
	background: #f5f5f5;
}
.d-purple-light {
	background: #e5e9f2;
}
.album {
	@include flex;
	align-items: flex-start;

	&__avatar {
		 background-color: $u-bg-color;
		 padding: 1px;
		 border-radius: 50rpx;
	 }

	&__content {
		 margin-left: 10px;
		 flex: 1;
	 }
}
.d-fenggegao {
	height: 550rpx;
}

</style>